package service;

public class User2 {
    private String username;
    private Car2 car2;
    public User2(){}
    public User2(String username,Car2 car2){
        this.username=username;
        this.car2=car2;
    }

    public User2(String username) {
        this.username=username;
    }


    public void goSchool(){
        System.out.println(this.getUsername()+"要去学校");
        this.car2.start();
        this.car2.run();
        this.car2.stop();
        System.out.println(this.getUsername()+"已经到学校");
    }
    public void goHome(){
        System.out.println(this.getUsername()+"要回家");
        this.car2.start();
        this.car2.run();
        this.car2.stop();
        System.out.println(this.getUsername()+"已经到家");
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Car2 getCar2() {
        return car2;
    }

    public void setCar2(Car2 car2) {
        this.car2 = car2;
    }
}
